import type { FC } from 'react'
import QuestionInputConf, { QuestionInputProsTpye } from './QuestionInput/index'
import QuestionTitleConf, { QuestionTitleProsTpye } from './QuestionTitle'
// 统一，各个组件的 prop type


export type ComponentPropsType = QuestionInputProsTpye & QuestionTitleProsTpye
export type ComponentConfType = {
    title: string
    type: string
    Component: FC<ComponentPropsType>
}

// 全部的组件配置的列表
const componentConfList: ComponentConfType[] = [
    QuestionInputConf,
    QuestionTitleConf
]

export function getComponentConfByType(type: string) {
    return componentConfList.find(c => c.type === type)
}
